import type { ResponseData } from ".";
import { ElMessage } from "element-plus";
import { useUserStore } from "@/store/modules/user";
export function handleCode(res: ResponseData<string>) {
  switch (res.code) {
    case 132:
      // 登录失败
      ElMessage.error("token过期,请重新登录");
      useUserStore().logOut();
      break;
    default:
      ElMessage({
        message: res.message,
        type: "error",
        duration: 3000
      });
      break;
  }
}
